*********************************************
******Goal: Set up code books for each DF****
******Author: Rithika Kumar  ****************
***************************************

*** Set working directory to "JOP Replication files" folder

** Install to export codebook 
ssc install asdoc, replace

*** 1. Survey Experiment (For Figure 1 - Long format)
use "DATA FILES TO SHARE/survey_experiment_long.dta", clear

label variable exp_rank1 "Who will you rank no. 1 in doing this task?"
label variable exp_mig_dummy "Is the husband present? (present = 0 i.e. husband is away that is he is migrant)"
label variable exp_child "What is the age of the child"
label variable exp_in_laws "Where do the woman's in-laws live?"
label variable mig_dummy "Is the respondent's own husband a migrant?"
*label define yesno 1 "Yes" 0 "No"   
label values mig_dummy yesno

*** Create codebook 
asdoc codebook, save(survey_experiment_long.doc) title(Codebook for Survey Experiment - Figure 1) replace

save "DATA FILES TO SHARE/survey_experiment_long.dta", replace


*** 2. Survey Experiment Unique Observation - For Appendix 

use "DATA FILES TO SHARE/survey_experiment_singleobs.dta", clear


asdoc codebook, save(survey_experiment_singleobs.doc) title(Codebook for Survey Experiment - Appendix) replace

*** 3. Survey (2022) 

use "DATA FILES TO SHARE/data_for_analysis_RK_controls.dta", clear 

asdoc codebook, save(data_for_analysis_RK_controls.doc) title(Codebook for Survey (2022)) replace
describe


*** 4. main_ew_hh_df - MAIN IHDS 

use "DATA FILES TO SHARE/main_ew_hh_df.dta", clear 

label variable year "Survey year: 0=2005-06;1=2011-12"
label variable hhuid_num "Household ID"
label variable PERSONID2005 "Respondent ID 2005"
label variable w1_abshusband_dummy "Was your husband a migrant in wave 1?"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable mig_status "Migrant Husband's category"
label variable vill_id_num "Village ID"
label variable pol_disc_yes "Do you discuss politics with your husband?"
label variable pol_immu_dummy "Do you have the immunization card for your child?"
label variable dil_dummy "Is the respondent a daughter-in-law (to household head)"
label variable rel_hindu "Hindu?"
label variable log_inc "Log of reported income?"
label variable dec_score_norm "Bargaining-power index"
label variable mob_rel "Do you need permission to go to visit your relatives?"
label variable mob_hc "Do you need permission to go to visit the health center?"
label variable mob_shop "Do you need permission to go to visit the nearby store?"
label variable mob_mandi "Do you need permission to go to visit the market?"
label variable mob_score_norm "Mobility index"
label variable pol_score_norm "Pol.Engagment index"
label variable did_sample "Is the respondent in the DID sample?"
label variable NR6 "Migrant husband's age"
label variable NR8 "Migrant husband's State of migration"
label variable NR9 "Migrant husband's distance of migration"
label variable NR11 "Migrant husband's occupation"
label variable NR10 "Migrant husband's education - classes completed"
label variable NR13A "Migrant husband's remittances received"
label variable mig_husb "Is your husband a migrant?"
label variable rel_muslim "Religion- Muslim?"
label variable sc "Schedule Caste"
label variable obc "Other Backward Caste"
label variable st "Schedule Tribe"


save "DATA FILES TO SHARE/main_ew_hh_df.dta", replace 

asdoc codebook, save(DATA FILES TO SHARE/main_ew_hh_df.doc) title(Codebook for Survey (2022)) replace
describe

use "DATA FILES TO SHARE/male_placebo_df.dta", clear 

label variable non_res "Is there a non-resident/migrant in the household?"
label variable year "Survey year: 0=2005-06;1=2011-12"
label variable did_sample "Is the respondent in the DID sample?"
label variable did "DID interaction: mighusband_w2Xyear_w2"
label variable vill_id_num "Village ID"
label variable hhuid "Household ID"

save "DATA FILES TO SHARE/male_placebo_df.dta", replace 

asdoc codebook, save(DATA FILES TO SHARE/male_placebo_df.doc) title(Codebook for Survey (2022)) replace
describe                  

use "DATA FILES TO SHARE/female_placebo_df.dta", clear 

label variable non_res "Is there a non-resident/migrant in the household?"
label variable year "Survey year: 0=2005-06;1=2011-12"
label variable did_sample "Is the respondent in the DID sample?"
label variable did "DID interaction: mighusband_w2Xyear_w2"
label variable vill_id_num "Village ID"
label variable hhuid_using2012_noyr "Household ID"


save "DATA FILES TO SHARE/female_placebo_df.dta", replace 

asdoc codebook, save(DATA FILES TO SHARE/female_placebo_df.doc) title(Codebook for Survey (2022)) replace
describe                  

use "DATA FILES TO SHARE/match_w1.dta", clear

label variable year "Survey year: 0=2005-06;1=2011-12"
label variable hhuid_num "Household ID"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable vill_id_num "Village ID"
label variable mob_score_norm "Mobility index"
label variable pol_score_norm "Pol.Engagment index"
label variable mig_husb "Is your husband a migrant?"
label variable dec_score_norm "Bargaining-power index" 

save "DATA FILES TO SHARE/match_w1.dta", replace
asdoc codebook, save(DATA FILES TO SHARE/match_w1.doc) title(Codebook for Survey (2022)) replace
describe 

use "DATA FILES TO SHARE/inc_earned_EW_analysis.dta", clear

label variable IDPSU "Village ID"
label variable hhuid_using2005 "Household ID 2005"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable year "Survey year: 0=2005-06;1=2011-12"
label variable ws_both_wave "Unique respondents across both waves"

save "DATA FILES TO SHARE/inc_earned_EW_analysis.dta", replace
asdoc codebook, save(DATA FILES TO SHARE/inc_earned_EW_analysis.doc) title(Codebook for Survey (2022)) replace
describe 

use "DATA FILES TO SHARE/farm_work_EW.dta", clear

label variable vill_id_num "Village ID"
label variable hhuid_num "Household ID"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable year "Survey year: 0=2005-06;1=2011-12"
label variable log_inc "Log of reported income"
label variable URBAN "URBAN area? 1=yes; 0=No i.e. rural"
label variable did_sample "Is the respondent in the DID sample?"

save "DATA FILES TO SHARE/farm_work_EW.dta", replace
asdoc codebook, save(DATA FILES TO SHARE/farm_work_EW.doc) title(Codebook for Survey (2022)) replace
describe 


use "DATA FILES TO SHARE/ihds_wages.dta"

label variable IDPSU "Village ID"
label variable hhuid_num "Household ID"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable year "Survey year: 0=2005-06;1=2011-12"
label variable dil_dummy "Is the respondent a daughter-in-law (to household head)"
label variable w2_abshusband_dummy "Was your husband a migrant in wave 2?"
label variable anotherst_dummy "Husband migrates to anotehr state?"
label variable anotherst_dummy "Migrant husband in anotehr state?"
label variable did_sample "Is the respondent in the DID sample?"
label variable URBAN "URBAN area? 1=yes; 0=No i.e. rural"
label variable farm_lab "Farm labor"


save "DATA FILES TO SHARE/ihds_wages.dta", replace
asdoc codebook, save(DATA FILES TO SHARE/ihds_wages.doc) title(Codebook for Survey (2022)) replace
describe 


 

